#ifndef DUOPL_PROGRESS_BASE_H
#define DUOPL_PROGRESS_BASE_H

#include <QWidget>
#include <QtGui>
#include <QProgressBar>

#define PYSB_EXTRA_SPACE 15
#define PYSB_RECT_RADIUS 10
#define PYSB_HEIGHT 30
#define PYSB_BG_START_COLOR QColor(121,121,121)
#define PYSB_BG_END_COLOR   QColor(78,78,78)
#define BG_MARGIN 4
#define BG_INER_MARGIN 2
class duopl_progress_base : public QWidget
{

    Q_OBJECT
public:
    explicit duopl_progress_base(QWidget *parent = 0);


    QSize sizeHint() const
    {
        return QSize(500,30);
    }

    QSize minimumSizeHint() const
    {
        return QSize(200,30);
    }
private:

    void paintEvent(QPaintEvent * e);
    /// painting functions
    qreal getCurPos();
    void drawBg(QPainter* painter);
    void drawBar(QPainter* painter);
    void drawText(QPainter* painter);
signals:

public slots:
    void UpdateData();
public:
    void setRange(qreal min,qreal max);

    void setValue(qreal value);

private:
    void initVariables();

private:
    qreal m_min;
    qreal m_max;
    qreal m_value;
};

#endif // DUOPL_PROGRESS_BASE_H
